﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using SPREST.Models;

namespace SPREST.Controllers
{
    public class SiteController : Controller
    {
        [AcceptVerbs("GET")]
        public ActionResult Index()
        {
            return All();
        }

        [AcceptVerbs("GET")]
        public ActionResult All()
        {
            return new HybridResult<List<Site>>(Site.GetAllWebs());
        }

        [AcceptVerbs("GET")]
        public ActionResult Get(string id)
        {
            return new HybridResult<Site>(Site.GetByID(id));
        }
    }
}
